home *** CD-ROM | disk | FTP | other *** search
- =========
- POWERBASE
- =========
-
- © Derek and Steven Haslam
-
- =======================
- Tutorials for Powerbase
- =======================
-
- Powerbase is an extremely powerful program with a great many features, but
- that doesn’t mean it is difficult to use. The procedures to search for,
- add, delete, edit and print records can be learned very quickly but, as with
- any new piece of software, the first steps often take the longest. This
- booklet uses some ready made example databases supplied on the distribution
- disc to help familiarise you with the main functions of the program.
-
- It consists of two sections. The first is a Quick Tutorial aimed at
- inexperienced users who may not have used a database program before. The
- Main Tutorial is meant for people who, although new to Powerbase, have some
- familiarity with other database programs. If you fall into this category you
- could skip the Quick Tutorial and move straight on to the Main Tutorial.
-
- The Figs.1-5 referred to in the text will be found in the supplied Drawfiles
-
- ==============
- Quick Tutorial
- ==============
-
- This tutorial is intended to acquaint the new user as painlessly as possible
- with the most commonly-used facilities of Powerbase. It does not explain how
- to create a database from scratch (for this, see Ch04-Creat in the Docs
- archive), nor does it delve into the many advanced features, but it does
- explain how to:
-
- (a) Start up Powerbase and open an existing database.
- (b) Browse through the database and search for individual records.
- (c) Add new records and alter or delete existing ones.
- (d) Query the database to create simple reports.
- (e) Close the database.
-
- The supplied sample database Friends is used to illustrate most of these
- activities. If you have a hard disc you should copy Friends and Powerbase
- itself onto it before proceeding further. It is possible to use Powerbase
- from floppy discs but some operations, such as printing lists, will be quite
- slow. Unless memory is very tight users of floppy discs are recommended to
- allocate at least 32K to the RAM disc and copy Friends onto it. Everything
- will then run much faster. Powerbase can provide context-sensitive help on
- its windows and menus via Acorn’s interactive Help application and you are
- advised to load this, resizing the help window and placing it at a
- convenient place on the screen. Further help can be had by choosing the Help
- entry which will be found on Powerbase’s main menu and also on the iconbar
- menu. The ultimate source of help is, of course, the main printed manual or
- the set of text files in the Docs archive.
-
- 1 Starting Powerbase
- =====================
- Double-click on the Powerbase icon. After a few seconds it will appear on
- the iconbar with the words “No data” beneath it to show that no database is
- open. Dragging the Friends icon to the Powerbase icon on the iconbar will
- open Friends for use and the words “No data” will be replaced by the name of
- the database.
-
- Two windows will open. One is the record window and displays the first
- record in the database, the one for Badgery, Peter. The other is the keypad
- which allows you to control the browsing, searching and editing functions of
- Powerbase. The keypad is rather large and obscures quite a big area of the
- record window, but the most-used buttons are on the top two rows. Clicking
- the “toggle size” icon (the small square at the right-hand end of its title
- bar) will reduce the keypad to just these rows. A second click restores it
- to full size. The keypad (in its reduced form) is shown in Fig.1 with
- numbers to identify the buttons referred to in these tutorials. (NOTE: If
- you are reading from the !!Tutorial textfile load the appropriate drawfile
- to see Figs.1 and 3, 2, 4 and 5)
-
- 2 Browsing and Searching
- =========================
- Now that you have a database running we will find out how to move from
- record to record and how to access any specific record by using a small
- group of letters called the key of the record. All the mouse clicks
- referred to (other than those for displaying menus) are made with the SELECT
- (left) button. If the chosen keypad action has an obvious opposite then you
- will find that using the ADJUST (right) mouse button brings about that
- effect. e.g. While SELECT on keypad button (4) takes you one record forward
- in the file, ADJUST on the same keypad button takes you one record back.
-
- 2.1 Browsing through the Records
- --------------------------------
- The top row of buttons on the keypad allows you to browse through the file.
- If you have Help running, as previously suggested, it will tell you what
- each button does. Once you get the general idea you will find the symbols on
- the buttons logical and self-explanatory. The most commonly used ones act as
- follows:
-
- (a) Buttons (1) and (2) take you to the first and final records. You are
- at the first record now, so click with SELECT on (2) and you will see
- the record for Turnip, Charles. (1) takes you back to Badgery, Peter
- again.
-
- (b) Movement through the file one record at a time is achieved using (3)
- and (4). Try them out, noting the way records come up in alphabetical,
- or reverse alphabetical, order.
-
- (c) Buttons (5) and (6) let you make longer jumps through a file. The number
- of records skipped is shown in the writable icon (7) and has a default
- value of 10. As there are only 10 records in Friends these keys will have
- the same effect as the “first” and “final” keys, unless you make the
- interval smaller. Click in (7), delete the 10 and enter 5 or 2, then try
- buttons (5) and (6) again.
-
- 2.2 Searching for a record
- --------------------------
- Button (8) shows a question mark followed by a “record card” icon. We will
- call it the Search button. When clicked with SELECT a small window opens to
- the right of the keypad. (See Fig.2) This is the Search window and contains
- a writable icon in which to enter the key of the record you wish to display.
- In this database keys are made up from the first 4 letters of the surname
- plus the initial so, if you wanted to call up the record for Bloggs Fred you
- would enter BLOGF. Do so, then click on Find (or type the Return key on the
- keyboard) and the record will be displayed. Note that the key is shown in
- the heading of the record window.
-
- If you enter a non-existent key Powerbase displays the record which most
- nearly matches the key, but flashes the key field to warn you that what is
- being displayed is not what you asked for.
-
- 3 Editing the Database
- =======================
- This part of the tutorial involves changes to the data. Make a working copy
- of the disc and put the original in a safe place. If you are using a copy of
- Friends on the RAM disc then the floppy disc won’t be altered, but it’s
- still not a good idea to work with the original disc.
-
- 3.1 Modifying records
- ---------------------
- Point at any field and click SELECT. The red text caret will appear in the
- field. The contents of the field may now be edited with the aid of the
- keystrokes which are standard for all RISC OS writable icons. i.e.
-
- Ctrl U clears the field.
- Delete removes the character to the left of the caret.
- Copy (or End) removes the character to the right of the caret.
- Shift Copy/End deletes the word to the right of the caret.
- Ctrl Copy/End deletes everything from the caret to the end of the line.
- ⇦ and ⇨ move the caret left/right by one character.
- Shift ⇦ and Shift ⇨ move the caret left/right by one word.
- Ctrl ⇦ and Ctrl ⇨ move the caret to start and end of the field.
-
- Having modified one or more fields you may be wondering what you have to do
- to make Powerbase save the modified record so that the changes won’t be
- lost. You don’t need to do anything! Powerbase will ensure that your changes
- are saved when you display a different record or close the database.
-
- 3.2 Recovering data after a mistake
- -----------------------------------
- You may edit the wrong field by mistake and want to restore the previous
- contents. Call up Bloggs Fred’s record and change the address from “12
- Woodland Road Exeter” to “12 Woodville Road Exmouth”. Now click MENU over
- the first line of the address. The second entry on the main menu (Field)
- contains a short group of characters called the tag of the field, in this
- case ADD1. Slide off the menu to the right, which opens the Field sub-menu,
- and choose the next to last entry; Undo changes. The contents of the field
- will revert to “12 Woodland Road”. Notice that only the first line of the
- address is affected; the town is still “Exmouth”. If you want to restore
- that field as well click MENU over it and follow the procedure just
- described.
-
- There might be occasions when you make a hopeless mess of a record and want
- to discard all the changes and revert to what you started with. You could,
- of course, “undo” each field separately as we just did for the street
- address and town but there’s a quicker way. Look near the bottom of the
- main menu, (just above Help) and you will see that here too is an Undo
- changes option. Choosing this undoes all the alterations you have made.
-
- It is important to realise that these facilities depend on the fact that
- Powerbase holds the currently-displayed record in memory and will therefore
- only work if the altered record has remained on display from the time you
- started changing it up to the point where you decided to “undo”. If you have
- looked at another record or clicked on Force update in the meantime then the
- changes will have been written to the disc and thus become “permanent”.
-
- 3.3 Adding and deleting records
- -------------------------------
- To add a new record we use button (9), Add record which looks like a plus
- sign and an index card. Clicking on this offers a blank record into which
- you can type new data. You don’t have to complete all the fields, in fact
- the only field into which you must type something is the NAME field. This is
- the key field; the one from which the key, mentioned earlier, is derived. If
- you leave the key field blank then nothing will be written to the database.
-
- Type the name “Bodmin George”, then go to the beginning of the file and
- step through it record by record. You will find that your new record has
- been inserted in the correct place, i.e. the sequence goes: Badgery, Bloggs,
- Bodmin, Cavendish. Now try deleting the record you’ve just added. If you
- refer to Fig.3 (which shows the portion of the keypad below the first two
- rows) you will see a “dustbin” button − (14) − which will do exactly that,
- but don’t use it just yet. Make sure that the unwanted record is on the
- screen and click button (16) instead. You will now find that Bodmin’s record
- has vanished; the names run straight from Bloggs to Cavendish, just as they
- did before you added Bodmin.
-
- This looks a bit too easy. Suppose you clicked the button by mistake and
- deleted an important record? No problem; what you have just done has been
- made easy because the action is far less drastic than it looks. The record
- hasn’t really been deleted at all. Click button (19) and “Bodmin” will
- reappear. You will soon find, however, that it appears to be the only record
- in the file! Don’t worry; nothing has been lost. A Powerbase database is
- treated as six separate subfiles numbered 0−5. When you first open the
- database you are looking at Subfile 0 and the heading of the record window
- shows this. If you look at the heading now you will see that it has changed
- to Subfile 1. Buttons (18) and (19) are used to change the current subfile.
-
- Buttons (15) and (16) do not delete records; they merely move records from
- one subfile to another. Button (16) moves the displayed record to the next
- subfile in sequence. Thus, in the above case the “Bodmin” record has been
- moved from subfile 0 to subfile 1. A record in subfile 1 would be moved to
- subfile 2 and so on. When it gets to 5 the next click moves it into subfile
- 0 where it was originally. As you may have guessed, button (15) moves
- records in the opposite direction, i.e. from subfile 1 to 0 or from subfile
- 0 to 5.
-
- If you do want to lose a record for good you consign it to the dustbin by
- clicking on (14). As this button’s action is more drastic than that of the
- other two you are given a chance to change your mind. A window headed
- Powerbase: please confirm: will appear displaying the question Delete record
- permanently? Clicking OK causes the record to be deleted, Cancel removes the
- warning window from the screen leaving the record untouched.
-
- 4 Printing Lists
- =================
- Before Powerbase can produce a list it must be told:
-
- • which fields should appear on the list
- • which records should appear on the list
-
- 4.1 Making the field selection
- ------------------------------
- Specifying the fields you want is extremely easy. To include a field point
- at it and click with ADJUST. The selected field will then appear with its
- foreground and background colours reversed. If you change your mind you can
- de-select it by clicking on it again with ADJUST. The order in which you
- select the fields is the order in which they will appear in the printed
- list.
-
- Take care with this as there is nothing on the screen to indicate
- what order the fields will be in (but see section 4.2 below). Field
- selections may be saved (using Save selection from the Print submenu) and
- reloaded for future use. For now select the name and the first 3 fields of
- the address.
-
- 4.2 Choosing which records to print
- -----------------------------------
- Specifying which records to print is somewhat more complicated. With the
- mouse pointer in the record window click MENU. This displays the main
- Powerbase menu from which you should choose Print. (You can achieve the same
- effect by typing the Print key on the keyboard.) A window called the Match
- window will open:
-
- Unless you have selected at least one field, as described in 4.1 the menu
- button (X) will be greyed out as illustrated. Otherwise, clicking on it will
- display a list of the selected fields in order of selection.
-
- The caret will be in the writable icon. This is where you specify the
- criteria which must be met by records for inclusion in the list. If you just
- click on the Print button (or type Return) without entering anything, you
- will obtain a list of the whole database (or, more accurately, of the the
- whole of the current subfile). Try that first.
-
- When the process is complete the list will be displayed in a window. If
- no records at all are printed make sure the icon for subfile 0 (Y in Fig. 4)
- is highlighted. Click on it with SELECT if it isn’t. If you point to a
- record in the list and double-click with SELECT Powerbase will display the
- chosen record in the main record window. Note that the caret is placed in
- the field you were pointing to on the list. This is very useful if you spot
- errors in the data whilst examining a list. A double click on the offending
- item offers the record with the caret correctly positioned for editing.
-
- Most queries involve printing only some of the records, not the whole
- database. To target a particular group of records we need to enter a search
- formula which will distinguish the records we want to print from all the
- rest of the records. Search formulae can be quite complex and a more
- detailed treatment is given in the Manual. Only a few simple examples are
- shown here. Enter the following and before clicking on Print.
-
- ADD2=Exeter
-
- The report window appears showing just one record: the one for “Bloggs
- Fred”. ADD2 is called the tag of the field. The label which appears beside a
- field on the screen is called its descriptor and you might have expected
- such labels to be used to refer to fields in search formulae. This is not
- done for two reasons:
-
- (1) Descriptors can be inconveniently long for use in this way.
- (2) Fields don’t necessarily have descriptors.
-
- Of the 5 address fields only the first and last have descriptors (Address
- and Postcode respectively). Since every data field needs a “handle” of some
- sort so that we can include it in a search formula we give each a tag, which
- is never more than 4 characters. Clicking MENU over a field makes its tag
- appear in the second menu item.
-
- The record for “Bloggs Fred” is, however, not the only one with an address
- in Exeter. There is another (“Sunningdale Samantha”) but with Exeter in ADD3
- rather than ADD2. You can print both on the same list by using the formula:
-
- ADD2,ADD3=Exeter
-
- Notice the way the alternative tags are separated by commas. We call this a
- tag list. A record will be printed if any one of the tags in the tag list is
- matched. The part of the search formula after the = sign is called the
- target and here too we may specify several in a target list. Try the
- following:
-
- ADD3=Exeter,Anytown
-
- and also: ADD2,ADD3=Exeter,Anytown
-
- The first of these examples prints the records for “Soap Joe” and
- “Sunningdale Samantha”, the second prints these two and “Bloggs Fred” as
- well. What the second formula is saying is “Print all the records which have
- either ‘Exeter’ or ‘Anytown’ in either the ADD2 or ADD3 field”.
-
- The characters we want to match don’t, of course, always make up the entire
- field. You can also search for part of a field. Suppose you wanted the
- records for people called Peter, Fred and Jean. Enter the formula:
-
- NAME{Peter,Fred,Jean
-
- and you will find that the records for “Badgery Peter”, “Bloggs Fred” and
- “Ford Jean” are printed. The curly bracket (“{”) means “contains”. i.e. the
- name field doesn’t have to consist wholly of Peter, or Fred or Jean, but has
- to contain one of these names somewhere within it.
-
- 4.3 Hard copy
- -------------
- So far you have displayed reports in a window. If you want to send them to
- your printer run Printers, switch on the printer, then click MENU over the
- displayed report. The Save as text option leads to a standard Save box from
- which you can drag the file icon to Printers on the iconbar. You could also
- drag it to a directory window to save it. Or you could simply type Return,
- in which case the report would be saved under a suitable default name in a
- directory called PrintJobs inside the Friends database directory. Every
- Powerbase database has a PrintJobs directory to use as a general dumping
- ground for reports and which needs to be cleared out periodically. Choose
- Show jobs done from the Print submenu to display it.
-
- If your printer is one of the more recent inkjets you might not be able to
- print plain text files by simply dragging them to the Printers icon as
- described above, because some such printers contain no fonts of their own.
- Clicking the icon Z in Fig.3 will open Powerbase’s Print Options window, at
- the top of which is an area marked Destination. Select the Printer button
- instead of the Window button and click on Accept. You should now be able to
- send output directly to the printer provided it is ready for use and
- Printers is running.
-
- 5 Closing down
- ===============
- A database may be closed down by choosing Close database from the iconbar
- menu. When you do so all relevant data stored in memory is saved to disc and
- the database is closed. You do not have to do anything to save the database
- file itself to disc since it has been there all along. Only the current
- record is in memory at any one time and this is automatically written back
- to disc when it has been changed in any way.
-
- If you are going to use another database straight away just double click on
- it or drag it to the Powerbase icon on the iconbar. In fact you don’t even
- need to close the previous database before doing this; Powerbase will do it
- for you. When working with a database on the RAM disc Powerbase will issue
- a warning that the data is not secure and that you need to drag it from the
- RAM disc to a floppy or hard disc before switching off. To terminate
- Powerbase itself use the Quit option on the iconbar menu.
-
- =============
- Main Tutorial
- =============
-
- This section is intended to acquaint a new user with the most commonly-used
- facilities of Powerbase. It does not explain how to create a database from
- scratch but it does explain how to:
-
- (a) Start up Powerbase and open an existing database.
- (b) Browse through the database and search for individual records.
- (d) Add new records and alter or delete existing ones.
- (d) Query the database to create simple reports.
- (e) Close the database.
-
- The sample database Elements is used to illustrate these activities. If you
- have a hard disc copy Elements and Powerbase itself onto it before
- proceeding further. It is possible to use Powerbase with floppy discs but
- some operations, such as printing lists, will be slow. Unless memory is very
- tight users of floppy discs are recommended to allocate at least 112K to the
- RAM disc and copy Elements onto it, which will make it much faster.
- Powerbase can provide context-sensitive help via Acorn’s interactive Help
- application and you are advised to load this, resizing the help window and
- placing it at the top right of the screen. Further help can be had by
- choosing the Help entry on Powerbase’s main menu or on the iconbar menu.
-
- 1 Starting Powerbase
- =====================
- Double-click on the Powerbase icon. After a few seconds it will appear on
- the iconbar with the words “No data” beneath it to show that no database is
- open. Dragging the Elements icon onto the Powerbase icon on the iconbar will
- open Elements for use and the words “No data” will be replaced by the name
- of the database. Double-clicking on the Elements icon has the same effect,
- in fact if Powerbase isn’t already on the iconbar a double-click on Elements
- will install it for you provided that the Powerbase icon has been seen by
- the filer.
-
- Two windows will open. One is the record window and displays the first
- record in the database. The other is the keypad which allows you to control
- the browsing, searching and editing functions of Powerbase. The keypad is
- rather large and obscures quite a big area of the record window. The
- most-used buttons, however, are on the top two rows and clicking the
- toggle-size icon at the top right-hand corner reduces it to just these rows.
- A second click restores the keypad to full size. Fig.1 in the Quick
- tutorial (printed version) shows the keypad in its reduced state and Fig.3
- shows the rest of the keypad which is revealed when you click it to full
- size. Load the drawfile Keypad if you are working from the !!Tutorial
- textfile. The numbers in brackets which occur in this tutorial refer to the
- numbering of the buttons in these two illustrations.
-
- 2 Browsing and searching
- =========================
- Now that you have a database running we will find out how to move from
- record to record and how to access any particular record by using a small
- group of letters called the key of the record. All the mouse clicks
- referred to (apart from those used to display menus) are made with the
- SELECT (left) button. If the chosen keypad action has an obvious opposite
- then you will find that using the ADJUST (right) mouse button brings about
- that effect. e.g. While SELECT on the top left keypad button takes you to
- the start of the file, ADJUST on the same keypad button takes you to the
- end.
-
- 2.1 Browsing through the records
- --------------------------------
- The top row of buttons on the keypad allows you to browse through the file.
- If you have !Help running, as previously suggested, it will tell you what
- each button does. Once you get the general idea you will find the symbols on
- the buttons logical and self-explanatory. The most commonly used ones act as
- follows:
-
- (a) Buttons (1) and (2) take you to the beginning and end of the file.
- (2) takes you to ZIRCONIUM and (1) to ACTINIUM.
-
- (b) Buttons (3) and (4) move by one record at a time. From ACTINIUM,
- clicking (4) takes you to ALUMINIUM whilst (3) takes you back to
- ACTINIUM.
-
- (c) Buttons (5) and (6) go through the file by longer jumps (6) takes you
- from ACTINIUM to BISMUTH and (5) back to ACTINIUM. The “fast forward/
- rewind” value is shown in the writable icon (7). It is initially set
- to 10 but can be altered by clicking in it with SELECT and entering a
- new value.
-
- At either end of the file “wrap around” occurs. If you are at the final
- record (ZIRCONIUM) one record forward takes you to ACTINIUM again.
- Similarly, one record back from ACTINIUM goes to ZIRCONIUM.
-
- The second row has buttons (10) and (11) marked like the “play” and “stop”
- controls of a cassette player. (10) starts an automatic flip-through of the
- records without the need to touch any other buttons. When you get to the
- place you want, click on (11). If the records go past too quickly you can
- slow the process down by increasing the number in the writable icon (7).
- (This is normally used to set the “fast-wind” interval; see above.)
-
- 2.2 Key fields, Keys and Indices
- --------------------------------
- When using the six buttons on the top row of the keypad you will have
- noticed that the records appear to be arranged alphabetically by the name of
- the element. The actual order in which records occur in the file is in fact
- nothing like alphabetical, but the order in which they are accessed is
- determined by an index which forces them to appear in alphabetical order.
- Every database must have at least one index, but you can have as many extra
- ones as you wish (subject to memory and disc limitations).
-
- The second row of the keypad has buttons (12) and (13) which feature a blue
- arrow with a key symbol. Click on (13) and the record for HYDROGEN is
- displayed. If you now experiment with the top row of buttons as before you
- will find that the records no longer appear in alphabetical order of name
- but in order of Atomic number instead. What we have done is change to a
- different index. If a database has several indices buttons (12) and (13)
- allow you to cycle through them in opposite directions. Since Elements has
- only two indices the two buttons have exactly the same effect. When you
- change to a different index the screen always displays the first record as
- determined by that index.
-
- An index is built from keys which are derived from a particular key field.
- The two indices used by Elements are based on the Name and Atomic number
- fields. The way in which the key stored in the index is derived from the key
- field differs in the two cases. For the Name index the first four letters of
- the name are used. Since no two elements have names beginning with the same
- four letters this gives a unique value for the key. (Two letters would not
- be enough because of names like CHLORINE and CHROMIUM.) The Atomic number
- index is based on the whole 3-digit maximum length and the ordering is
- numeric. Whenever a record is displayed the key is shown in the window
- title.
-
- The record screen shows which fields are key fields and which are not. The
- labels, or descriptors, of fields are normally black. Where the fields are
- key fields they are shown in dark blue instead and the field related to the
- current index has its descriptor in red. Note also that the background
- colour of the NAME field is pale yellow whereas the rest are white. This
- indicates that NAME is the primary key field. The primary key is more
- important than the others. The index based on it is the only one which every
- database must have and is the one selected when a database is first opened.
-
- 2.3 Searching for a record
- --------------------------
- Button (8) shows a question mark followed by a “record card” icon We will
- call it the Search button. When clicked with SELECT a small window, the
- Search window, opens to the right of the keypad (see Fig.2). It contains a
- writable icon in which to enter the key of the record you wish to display.
- Suppose you want to see the record for the element NITROGEN. If the current
- index is the Name then enter NITR and either type the Return key on the
- keyboard or click on the Find button. The required record quickly appears.
- If you enter the key of a non-existent record Powerbase displays the record
- which most nearly matches the key, but flashes the key field to warn you
- that what is being displayed is not what you asked for. You don’t
- necessarily need to type the whole key; NIT would do in this case, but NI
- would be ambiguous (there are elements called NICKEL and NIOBIUM).
-
- To find NITROGEN when the Atomic number index is active you would need to
- know that the atomic number of nitrogen is 7. Change key, enter this number
- and type Return or click on Find. The required record appears. Abbreviated
- keys are not allowed in this case for obvious reasons; if you want element
- 103 (LAWRENCIUM) it’s no good entering 10 (NEON)!
-
- You might want to examine a group of related records, e.g. the six similar
- elements LITHIUM, SODIUM, POTASSIUM, RUBIDIUM, CAESIUM and FRANCIUM which
- are known as the Alkali Metals. You could, of course, look up each in turn
- by entering its key but there is a better way. Click on (17); the Filter
- button. The button becomes ticked and the Filter window (Fig.5) opens on the
- right of the keypad. This button is what we call an option switch and is
- used to turn a particular feature ON or OFF. The six elements referred to
- all occur in group 1 of the Periodic Table of the elements so type GP=1 into
- the writable icon. and click on Filter (in the Filter window, not on the
- keypad). The record for CAESIUM is displayed. If you experiment with the
- buttons on the top row of the keypad you will find that they behave as if
- the six Alkali Metals were the only elements in the database; all the rest
- have been “filtered out” so that you access only the ones you are interested
- in. To return to normal operation either click the Cancel button on the
- Filter window or turn off the switch on the keypad. If you want the Filter
- window out of the way without cancelling the filter click on Close.The
- option switch on the keypad remains selected.
-
- 3 Editing the Database
- =======================
- This part of the tutorial involves changes to the data records. Make a
- working copy of the disc and put the original in a safe place. If you are
- using a copy of Elements on the RAM disc the floppy disc won’t be altered,
- but it’s not a good idea to work with the original disc.
-
- 3.1 Modifying records
- ---------------------
- Pointing the mouse at any field and clicking SELECT places the caret in that
- field. The contents of the field may then be edited in the standard way for
- RISC OS writable icons, with which you will be familiar. Changes made to a
- record cause the record to be written back to the database whenever you
- display a different record or close the database. There is a button (24) on
- the keypad called Force update but you don’t normally need to use it.
-
- 3.2 Using the scratchpad
- ------------------------
- It is sometimes necessary to copy the contents of one field into another,
- either in the same record or a different record. This can be done with the
- aid of the scratchpad which is controlled by buttons (21) and (22). Place
- the caret in the field you want to copy and click on (21). This copies the
- contents of the field onto the scratchpad. Moving the caret to another field
- and clicking (22) writes the data from the scratchpad into that field,
- over-writing its previous contents. You may continue to “paste” the data
- into new fields as often as you like. Only when you click (21) again are the
- contents of the scratchpad changed. Data pasted into a field will not be
- allowed to overflow; if too long for the field it will be cut to the
- permitted length. As an added precaution you can’t paste into a field if
- there is nothing on the scratchpad so accidental blanking of fields is
- avoided. If you use a wordprocessor, whether on an Acorn machine or not,
- you will probably be familiar with the keystrokes Ctrl-C and Ctrl-V for Copy
- and Paste. You can use these in Powerbase too; they do exactly the same as
- buttons (21) and (22)
-
- 3.3 Undoing mistakes
- --------------------
- You might edit the wrong field by mistake and want to restore the previous
- contents. Click MENU over the field. The second entry on the main menu
- contains the tag of the field. Slide off the menu to the right to open the
- Field sub-menu and choose Undo changes. The previous contents of the field
- will be restored. Similarly, if you make a mess of a whole record and want
- to go back to the way it was you can choose Undo changes from the main menu.
- It is important to realise that the Undo facilities will not work if you
- have looked at another record before using them (or clicked on Force
- update). You can only recover data which has been altered in or removed from
- the currently-displayed record.
-
- 3.4 Adding new records
- ----------------------
- First we will add a new record for a fictitious element as described below:
-
- NAME TASMANIUM
- SYMBOL Ts
- ATOMIC NUMBER 108
-
- Button (9) has a plus sign and a “record card” icon. This is the Insert
- button. A blank record will be displayed with the caret in the NAME field.
- Enter TASMANIUM here and type Return. The caret will jump to the SYMBOL
- field. Enter Ts. You will now need to press Return twice to get to ATOMIC
- NUMBER (One press takes you to the field after NAME where the origin of the
- element’s name is given. The field has no descriptor.) Alternatively you
- could point the mouse at the ATOMIC NUMBER field and click SELECT. There is
- no need to press Return after entering a field in order to accept the data;
- it’s just the most convenient way of getting to the next field. When
- entering data into widely-scattered fields it is more convenient to use the
- mouse to move the caret.
-
- Having entered the data click any of the first row of buttons so that a
- different record is shown. Now use Search to find TASMANIUM by name (its key
- will be TASM). Change to the Atomic number index and find it by atomic
- number (108). In both cases try moving to the record just before and just
- after the new one, noting that it has been placed in its correct position in
- both indices: between TANTALUM and TECHNETIUM in the Name index and at the
- end of the Atomic number index.
-
- 3.5 Data Input Validation
- -------------------------
- When entering the above data you may have noticed that the Name field will
- only accept capital letters and the Atomic number field will only accept
- numerals. Any others are simply ignored. We call this feature character
- validation. Another level of data validation, which we will now illustrate,
- is called table validation Make an entry in the Group field. Type X, for
- example, then try to move to another field by either typing Return or
- clicking the mouse. You will find that you can’t do so; you get an error
- message instead. This is because the Group field is linked to a validation
- table which means that only entries which appear in the table may be used in
- that field. Fields linked to validation tables are distinguished by using
- dark green, instead of black, as the foreground colour.
-
- To see what the validation table contains, place the caret in the Group
- field then click on the List values button, (23). The validation table will
- be displayed in its own window. Only items in the left column of the table
- may be entered in the Group field. Element 108 would be a transition metal,
- so enter T. You will now find that Powerbase accepts your data. Both
- character validation and table validation may be turned off and on by means
- of a switch on the Preferences window. To get at this window click MENU over
- the Powerbase icon on the iconbar and choose Preferences from the iconbar
- menu. The rather large window which appears has a collection of option
- switches down its left-hand side. The sixth of these (Validate input) is
- normally ON to indicate that validation is in effect. Click to turn it off
- then click on Accept. The Preferences window will be removed from the screen
- and you will find that input is no longer being validated.
-
- 3.6 Deleting records
- --------------------
- Since “tasmanium” isn’t a real element we want to remove it from our
- database. Button (14), the “dustbin”, will do exactly that but we won’t use
- it just yet. Make sure that the unwanted record is on the screen and click
- button (16). You will now find that TASMANIUM has vanished; the names run
- from TANTALUM to TECHNETIUM and the atomic numbers end with 103, just as
- they did before you added the extra record.
-
- What if you had clicked the button by mistake and deleted an important
- record? Powerbase handles this very nicely. The record hasn’t really been
- deleted at all. To prove this, click on (19). This shows a green
- right-pointing arrow and a “card index” icon. TASMANIUM will reappear. You
- will also find that it appears to be the only record in the file! Don’t
- worry; nothing has been lost. A Powerbase database is treated as six
- separate subfiles numbered 0-5. When you first open the database you are
- looking at Subfile 0 and the heading of the record window shows this. If you
- look at the heading now you will see that it has changed to Subfile 1. The
- button you have just clicked advances the subfile number by 1. When you
- reach subfile 5 the next click takes you to subfile 0. Its counterpart,
- button (18), has the opposite effect.
-
- Buttons (15) and (16) do not delete records; they merely move records from
- one subfile to another. Button (16) moves the displayed record to the next
- subfile in sequence. Thus, in the above case TASMANIUM has been moved from
- subfile 0 to subfile 1. A record in subfile 1 would be moved to subfile 2
- and so on. When it gets to 5 the next click moves it into subfile 0 where it
- was originally. As you may have guessed, (15) moves records in the opposite
- direction, i.e. from subfile 1 to 0 or from subfile 0 to 5.
-
- If you do want to lose a record for good you consign it to the dustbin by
- clicking (14). As this button’s action is more drastic than that of the
- other two you are asked to confirm that this really is what you want to do
- before the deletion goes ahead.
-
- 4 Printing Lists
- =================
- Before Powerbase can produce a list it must be told:
-
- • which fields should appear on the list
- • which records should appear on the list.
-
- 4.1 Making the field selection
- ------------------------------
- Specifying the fields you want is extremely easy. To include a field point
- the mouse at it and click with ADJUST. The selected field will appear with
- its foreground and background colours reversed. If you change your mind
- about a field you can de-select it by clicking on it again with ADJUST. The
- order in which the fields will appear in the printed list is the order in
- which you select them. Take care since there is nothing on the screen to
- indicate what order the fields will be in (although you can inspect the
- order once you have opened the Match window by clicking on the menu button
- labelled X in Fig.4). The fields chosen for inclusion in a printout make up
- a selection which may be saved, using Save selection from the Print submenu,
- and reloaded for future use. Just for now select Name, Symbol and Group.
-
- 4.3 Choosing which records to print
- -----------------------------------
- Specifying which records to print is more complicated. With the pointer in
- the record window click MENU. This displays the main Powerbase menu from
- which you should choose Print. A small window appears (see Fig.4) in which
- you specify the criteria which must be met by records for inclusion in the
- list. If you just click the Print button (or type Return) without entering
- anything here you will obtain a list of the whole database (or, more
- accurately, the the whole of the current subfile). Try this first.
-
- Nothing will be printed until the process is complete. The list will then be
- displayed in a window. If no records at all are printed make sure the icon
- for subfile 0 (Y in Fig. 4) is highlighted. If the mouse pointer is over the
- main window the hourglass will tell you how far things have progressed.
- Pressing Escape will cause the process to be aborted. Assuming you now have
- a list in a window, clicking MENU over it displays a menu which leads to a
- Save box. You may save the list as a text file by dragging the file icon to
- a filer window or print it by loading Printers and dropping the file icon on
- the Printers icon on the iconbar *. If you point to a record in the
- displayed list and double-click with SELECT Powerbase will display the
- chosen record in the main record window. Moreover the caret is placed in the
- field you were pointing to on the list. This is very useful if you spot
- errors in the data whilst examining a list. A double click on the offending
- item offers the record with the caret correctly positioned for editing.
-
- Most database queries don’t, of course, involve printing all the records.
- You will usually need to enter a search formula before clicking Print. You
- have already used a simple search formula when you typed GP=1 to filter out
- all but the six Alkali Metal records (see 2.3). Search formulae can be
- complex and a more detailed treatment is given in Ch03-Print. Only a few
- simple examples are shown here.
-
- Suppose we want a list of all transitional elements. i.e. all those which
- have T in the GROUP field. We can do this by entering the search formula:
-
- GP=T
-
- Why GP? Group=T seems the more obvious choice but Elements contains many
- fields which have no label, such as the one on the first line which gives
- the origin of the element’s name. Every field which can hold data has to
- have a handle by which we can refer to it and that handle is called the
- field tag. Tags are very short; never more than four characters. You have
- seen some tags already. Look at the list you printed earlier. The three
- columns are headed with the tags (NAME, SYM and GP) not the descriptors
- (Name, Symbol and Group). We therefore meets tags in two contexts:
-
- • specifying fields in search formulae
- • as the default column headings in lists
-
- The Print options window, displayed by choosing Options from the Print
- submenu, lets you change the column headings to field descriptors if you
- prefer them, but it is always the tags which are used in formulae.
-
- Type GP=T in the space provided and click Print. This time the list will be
- a much shorter one and you will see that the GP column contains T in every
- case.
-
- The second example involves printing all elements whose names end in “IUM”.
- What we need to specify is that the Name contains IUM and we do this by
- entering the search formula:
-
- NAME{IUM
-
- Note the use of a left brace (curly bracket) to mean “contains”. Another
- way to perform this search is to use a wild-card. Type:
-
- NAME=$IUM
-
- Clicking Print will produce the same list as before. The “$” is a wild-card
- character which can represent any number of unspecified characters. The
- search formula is saying in effect, “I don’t care what the first part of the
- name is as long as it ends with IUM”.
-
- We will combine the previous two examples into a two-pronged search for all
- the TRANSITIONAL elements whose names end in “IUM”. The search formula this
- time is either:
-
- NAME{IUM AND GP=T
-
- or: NAME=$IUM AND GP=T
-
- Note the spaces before and after AND. These are essential. You might like to
- try an alternative way of entering a search formula. It is designed for new
- users of a database or for occasional users who might forget what the tags
- of the fields are. Proceed as follows:
-
- 1. Click the Help button on Print window. This opens the Help window.
- 2. NAME should already be visible as the required field, but you need to select the radio button for contains.
- 3. Click in the space next to Value and enter IUM.
- 4. Click Add to formula. The search formula now reads NAME{IUM.
- 5. Click the AND button.
- 6. Click on the “menu” button to the right of the tag display and choose item 6 (GP)
- 7. Select the radio button for is equal to
- 8. Enter T in the Value field.
- 9. Click Add to formula
-
- The complete search formula should now be visible so click Print and the
- list will be produced. The procedure takes far longer to describe than to do
- and can be a great help to the infrequent Powerbase user who has trouble
- remembering the syntax of search formulae. If you use complex queries often
- you may find it convenient to save them for future use. Save query from the
- Print submenu enables you to do this.
-
- The biggest problem you are likely to encounter is not knowing the tags for
- the various fields. By using the above method you can see all the tags
- displayed in a menu or cycle through them using a pair of arrowheads (“bump”
- icons). It is also useful to know that clicking with SELECT on a field while
- holding down Ctrl causes the tag of that field to appear in the search
- formula icon.
-
- 5 Merging data into an Impression document
- ===========================================
- The distribution disc contains a simple Impression document called
- MergeTest. It will be used in conjunction with the Elements database to
- illustrate direct data-merging with Impression.
-
- (1) Ensure that Impression has been “seen” by the filer. (You need not
- actually load it.)
-
- (2) Open the Elements database and drop MergeTest onto the record
- window. The Data merge window will appear.
-
- (3) Click on Merge. You will see that data relating to the record for
- ACTINIUM has been inserted into the Impression document.
-
- (4) The browse buttons on the keypad, may be used to move through the
- database merging different records into the document.
-
- (5) If a Filter has been specified it will restrict the merge operation
- to records matching the filter formula.
-
- (6) Print may be used to print the document with the currently-merged
- data. To print a set of documents, one for each matching element,
- select Print all before clicking on Merge.
-
- During data-merging Impression editing is disabled; you can’t place the
- caret in the document and the mouse pointer appears as a red and blue cross.
- Clicking on Cancel or closing the Data merge window restores normal editing.
-
- For more information on data-merging, including instructions on how to
- prepare the Impression document, see Ch09-Merge.
-
- 6 Closing down
- ===============
- A database may be closed down by choosing the Close database entry from the
- iconbar menu. When you do so, all the indices stored in memory are saved to
- disc and the database is closed. You do not have to do anything to save the
- database itself to disc since it has been there all along. Only the current
- record is in memory at any one time and this is automatically written back
- to disc when it has been changed in any way.
-
- Also saved automatically is the link file which holds the links between
- the main database and the validation tables. The tables themselves are also
- saved.
-
- If you are going to use another database straight away just double click on
- it or drag it to the Powerbase icon on the iconbar. In fact you don’t even
- need to close the previous database before doing this; Powerbase will do it
- for you. When working with a database on the RAM disc Powerbase will issue
- a warning that the data is not secure and that you need to drag it from the
- RAM disc to a floppy or hard disc before switching off. To terminate
- Powerbase itself use the Quit option on the iconbar menu.
-